package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.Unit;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();


    List<Goods> getListInventory(@Param("page") Integer page, @Param("rows")Integer rows, @Param("codeOrName")String codeOrName, @Param("goodsTypeId")Integer goodsTypeId);

    int count();

    List<Unit> getUnitList();

    List<Goods> getGoodsList(@Param("page") Integer page, @Param("rows")Integer rows, @Param("goodsName")String goodsName, @Param("goodsTypeId")Integer goodsTypeId);

    void updateGoods(Goods goods);

    void saveGoods(Goods goods);

    List<Goods> getNoInventoryQuantity(@Param("page") int page, @Param("rows") Integer rows, @Param("nameOrCode") String nameOrCode);

    int countNoInventory();

    List<Goods> getHasInventoryQuantity(@Param("page") int page, @Param("rows") Integer rows, @Param("nameOrCode") String nameOrCode);

    int countHasInventory();

    void saveStock(@Param("goodsId") Integer goodsId, @Param("inventoryQuantity") Integer inventoryQuantity, @Param("purchasingPrice") double purchasingPrice);

    void deleteGoods(@Param("goodsId") Integer goodsId);

    Goods selectById(@Param("goodsId") Integer goodsId);

    List<Goods> getListAlarm();

}
